Media relays are typically used to provide Network Address Translation (NAT) traversal for media streams (e.g., a voice media stream) in a communication session. Large Enterprises and applications hosted in data centers may have multiple media relays distributed throughout the world in order to handle traffic that is not sent directly between communication devices. For example, a communication session between a Web Real-Time Communication (WebRTC) communication device and a second communication device on the Public Switched Telephone Network (PSTN) may need to use a media relay.
WebRTC client applications use Domain Name System (DNS) to resolve hostnames to Internet Protocol (IP) addresses to determine where to send Hypertext Transfer Protocol (HTTP) requests. Consistent with other Hyper Text Markup Language (HTML) content on the web, many service providers use location-aware DNS to ensure browser traffic in a geographical region is served by the data center closest to the physical location of the browser. This may be because of performance issues, but it could also be because of regulatory or localization issues (e.g., providing text in different languages). For example, a user doing a Google™ search in North America will not use the same data center to get the same response as a user doing the same Google™ search in Asia. This solution works well for basic web traffic. However, this solution falls short when a communication session needs to use a media relay.